<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'stu.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
  
  		<jsp:useBean id="stu1" class="com.inspur.bean.Student" scope="page"></jsp:useBean>
  		<jsp:useBean id="stu2" class="com.inspur.bean.Student" scope="session"></jsp:useBean>
  	
  	
  		<jsp:setProperty name="stu1" property="stuNo" value="10"/>
  		<jsp:setProperty name="stu1" property="stuName" value="张三" />
  		<jsp:setProperty name="stu1" property="stuAge" value="23"/>
  	
  		编号：<jsp:getProperty name="stu1" property="stuNo" /><br/>
  		姓名：<jsp:getProperty name="stu1" property="stuName" /><br/>
  		年龄：<jsp:getProperty name="stu1" property="stuAge" />
	<%--   		<%
  			stu1.setStuNo(2);
  			stu1.setStuName("李四");
  			stu1.setStuAge(25);
  			stu2.setStuNo(3);
  			stu2.setStuName("王五");
  			stu2.setStuAge(30);
  		 %>
  --%>
  	
<%-- 	
		编号2：<%=stu1.getStuNo() %>
		姓名2：<%=stu1.getStuName() %>
		年龄2：<%=stu1.getStuAge() %>
		<br/>
		
	编号3：<%=stu2.getStuNo() %>
		姓名3：<%=stu2.getStuName() %>
		年龄3：<%=stu2.getStuAge() %>
<%
		Student stu=new Student();
		stu.setStuNo(1);
		stu.setStuName("张三");
		stu.setStuAge(23);
	
	 %>

	编号：<%=stu.getStuNo() %>
	姓名：<%=stu.getStuName() %>
	年龄：<%=stu.getStuAge() %>
--%>
  </body>
</html>
